home *** CD-ROM | disk | FTP | other *** search
-
-
-
- VVVVkkkkMMMMeeeetttteeeerrrr((((3333xxxx)))) VVVVkkkkMMMMeeeetttteeeerrrr((((3333xxxx))))
-
-
-
- NNNNAAAAMMMMEEEE
- VkMeter - Display a layered bar graph
-
- IIIINNNNHHHHEEEERRRRIIIITTTTSSSS FFFFRRRROOOOMMMM
- VkDoubleBuffer : VkComponent : VkCallbackObject
-
- HHHHEEEEAAAADDDDEEEERRRR FFFFIIIILLLLEEEE
- #include <Vk/VkMeter.h>
-
- PPPPUUUUBBBBLLLLIIIICCCC PPPPRRRROOOOTTTTOOOOCCCCOOOOLLLL SSSSUUUUMMMMMMMMAAAARRRRYYYY
- CCCCoooonnnnssssttttrrrruuuuccccttttoooorrrr////DDDDeeeessssttttrrrruuuuccccttttoooorrrr
- VkMeter(const char *name, Widget parent);
- virtual void ~VkMeter(void);
-
-
- AAAAddddddddiiiinnnngggg DDDDaaaattttaaaa
- void reset(int range = -1, int units = -1);
- void add(int value, char *color, char *label = NULL);
- void add(int value, Pixel pixel, char *label = NULL);
- void add(int value, int thickness, char *color,
- char *label = NULL);
- void add(int value, int thickness, Pixel pixel,
- char *label = NULL);
- void add(int start, int size, int sideValue, int thickness,
- char *color, char *label = NULL);
- void add(int start, int size, int sideValue, int thickness,
- Pixel color, char *label = NULL);
-
-
- DDDDrrrraaaawwwwiiiinnnngggg tttthhhheeee MMMMeeeetttteeeerrrr
- void update();
-
-
- GGGGeeeeoooommmmeeeettttrrrryyyy
- void setOrientation();
- void setResizePolicy( unsigned char policy);
-
-
- XXXX RRRREEEESSSSOOOOUUUURRRRCCCCEEEESSSS AAAASSSSSSSSOOOOCCCCIIIIAAAATTTTEEEEDDDD WWWWIIIITTTTHHHH TTTTHHHHIIIISSSS CCCCLLLLAAAASSSSSSSS
- orientation,
- colorList,
- autoScale
-
-
- CCCCLLLLAAAASSSSSSSS DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- The VkMeter class supports simple compound bar charts. Single or
- multiple data items can be displayed in a double-buffered window.
- The meter can be displayed in vertical or horizontal mode.
-
- The VkMeter class allows one or more integer values to be displayed
- graphically. Values are added one at a time, and displayed by
- calling an _u_p_d_a_t_e() member function. The range of values displayed
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- VVVVkkkkMMMMeeeetttteeeerrrr((((3333xxxx)))) VVVVkkkkMMMMeeeetttteeeerrrr((((3333xxxx))))
-
-
-
- can be specified by calling the _r_e_s_e_t() member function with a new
- value. See examples below.
-
-
-
- FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNN DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNNSSSS
- VVVVkkkkMMMMeeeetttteeeerrrr(((())))
- VkMeter(const char *name, Widget parent);
-
-
- Initialize an instance of VkMeter.
-
- ~~~~VVVVkkkkMMMMeeeetttteeeerrrr(((())))
- virtual void ~VkMeter(void);
-
-
- Free all memory allocated by an VkMeter object.
-
- rrrreeeesssseeeetttt(((())))
- void reset(int peak = -1, int units = -1);
-
-
- This function clears the values of all currently displayed data and
- optionally sets the peak value to be displayed by the meter. The
- second argument can be used to specify a scale factor to be applied
- to the "width" of the data displayed by the meter. If no values are
- specified, the peak value defaults to 100, and the unit size
- defaults to 1.
-
- aaaadddddddd(((())))
- void add(int value, char *color, char *label = NULL);
- void add(int value, Pixel pixel, char *label = NULL);
- void add(int value, int thickness,
- char *color, char *label = NULL);
- void add(int value, int thickness,
- Pixel pixel, char *label = NULL);
-
- void add(int start, int size, int sideValue,
- int thickness, char *color, char *label = NULL);
- void add(int start, int size, int sideValue,
- int thickness, Pixel color, char *label = NULL);
-
-
- All forms of this overloaded function add a data item to be
- displayed by the meter. The _v_a_l_u_e argument indicates a value to be
- displayed in the graph. When one of the first four forms of this
- function are used, multiple data items are displayed sequentially.
- For example, if the range is set to 100 (the default) and value of
- 10, 20, and 30 are added, the meter will display a bar from 0-10,
- 10-30, and 30-60.
-
-
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-
-
-
- VVVVkkkkMMMMeeeetttteeeerrrr((((3333xxxx)))) VVVVkkkkMMMMeeeetttteeeerrrr((((3333xxxx))))
-
-
-
- All data items must have an associated color. The color can be
- specified as a pixel value, or as a string. When a string is
- provided, the string is first treated as the name of a resource to
- be looked up and converted to the desired color. If no such resource
- is found, the string is taken to be the name of a color. For
- example, items might be added as follows:
-
-
- add(10, "red")
- add(20, "DataTwoColor");
-
-
-
- The second and third forms of the _a_d_d() function allow a _t_h_i_c_k_n_e_s_s
- to be specified as well. This value controls the width of each item
- in the bar when the bar is vertical and the height when the bar is
- horizontal.
-
- The final two forms of the _a_d_d() function provide the most control
- over the data displayed in the meter. The first and second arguments
- specify the starting point of the data (the bottom, when the meter
- is vertical) and the size. The third and fourth arguments specify a
- starting point and size in the opposite dimension. For example:
-
-
- add(0, 10, 0, 1, "red");
- add(0, 10, 1, 1, "blue");
- add(0, 10, 2, 1, "green");
- add(20, 10, 0, 3, "yellow");
-
-
-
- When the graph is vertical, this produces a display with three
- vertical lines from 0-10, side by side, in red, yellow and green.
- Above these three lines is a space, and a yellow bar starts at 20
- and extends to thirty. This yellow strip is as wide as all three of
- the previous lines. The total width of the displayed graph is equal
- to the sum of the widths times the scale factor specified in the
- call to reset.
-
- uuuuppppddddaaaatttteeee(((())))
- void update();
-
-
- This function causes all values added with the _a_d_d() member function
- to be displayed.
-
- sssseeeettttRRRReeeessssiiiizzzzeeeePPPPoooolllliiiiccccyyyy(((())))
- void setResizePolicy( unsigned char policy )
-
-
-
-
-
-
- PPPPaaaaggggeeee 3333
-
-
-
-
-
-
- VVVVkkkkMMMMeeeetttteeeerrrr((((3333xxxx)))) VVVVkkkkMMMMeeeetttteeeerrrr((((3333xxxx))))
-
-
-
- This function allows applications to determine the dynamic resize
- policy followed by the meter. Possible values are XmRESIZE_NONE,
- XmRESIZE_GROW, or XmRESIZE_ANY. If the policy is set to
- XmRESIZE_NONE, the meter will never attempt to resize itself. The
- application, or managing widget is in complete control. If the value
- is set to XmRESIZE_GROW, the meter will call _X_t_S_e_t_V_a_l_u_e_s() on the
- widget used to display the meter to attempt to grow as needed. The
- success of the call to _X_t_S_e_t_V_a_l_u_e_s() depends, of course, on the
- parent widget's policy. If The resize policy is set to XmRESIZE_ANY,
- the meter will attempt to resize itself to grow or shrink as needed.
-
- This function is not currently used by the VkMeter class, but is
- used by derived classes.
-
- sssseeeettttTTTTiiiittttlllleeee(((())))
- void setTitle( const char *title )
-
-
- Specifies a title to be displayed by the meter. This function is
- not currently used by the VkMeter class, but is used by derived
- classes.
-
- EEEEXXXXAAAAMMMMPPPPLLLLEEEE
- The following example creates a meter component that displays four
- values.
-
-
- #include <Vk/VkApp.h>
- #include <Vk/VkSimpleWindow.h>
- #include <Vk/VkMeter.h>
- #include <math.h>
-
- class MeterWindow: public VkSimpleWindow {
-
- public:
-
- MeterWindow ( const char *name );
- ~MeterWindow ();
- virtual const char* className();
- };
-
- MeterWindow::~MeterWindow ()
- {
- // Empty
- }
-
- const char* MeterWindow::className()
- {
- return "MeterWindow";
- }
-
- MeterWindow::MeterWindow(const char *name) :
-
-
-
- PPPPaaaaggggeeee 4444
-
-
-
-
-
-
- VVVVkkkkMMMMeeeetttteeeerrrr((((3333xxxx)))) VVVVkkkkMMMMeeeetttteeeerrrr((((3333xxxx))))
-
-
-
- VkSimpleWindow(name)
- {
- VkMeter *meter = new VkMeter("meter",
- mainWindowWidget());
-
- meter->reset(100);
- meter->add ((int) (10.0 ), 20, "red" );
- meter->add( (int) (20.0), 20, "green" );
- meter->add( (int) (30.0 ), 20, "blue" );
- meter->add( (int) (40.0), 20, "orange");
-
- meter->update( );
-
- meter->show();
-
- addView( meter);
- }
-
- void main ( int argc, char **argv )
- {
- VkApp *meterApp = new VkApp("MeterApp",
- &argc, argv);
-
- MeterWindow *meterWin = new MeterWindow("meter");
- meterWin->show();
- meterApp->run();
- }
-
-
-
- IIIINNNNHHHHEEEERRRRIIIITTTTEEEEDDDD MMMMEEEEMMMMBBBBEEEERRRR FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNNSSSS
- IIIInnnnhhhheeeerrrriiiitttteeeedddd ffffrrrroooommmm VVVVkkkkDDDDoooouuuubbbblllleeeeBBBBuuuuffffffffeeeerrrr
- _canvas, _width, _height
-
-
- IIIInnnnhhhheeeerrrriiiitttteeeedddd ffffrrrroooommmm VVVVkkkkCCCCoooommmmppppoooonnnneeeennnntttt
- installDestroyHandler(), removeDestroyHandler(), widgetDestroyed(),
- setDefaultResources(), getResources(), manage(), unmanage(),
- baseWidget(), okToQuit(), _name, _baseWidget, _w, deleteCallback
-
-
- IIIInnnnhhhheeeerrrriiiitttteeeedddd ffffrrrroooommmm VVVVkkkkCCCCaaaallllllllbbbbaaaacccckkkkOOOObbbbjjjjeeeecccctttt
- callCallbacks(), addCallback(), removeCallback(),
- removeAllCallbacks()
-
-
- KKKKNNNNOOOOWWWWNNNN DDDDEEEERRRRIIIIVVVVEEEEDDDD CCCCLLLLAAAASSSSSSSSEEEESSSS
- VkPie
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 5555
-
-
-
-
-
-
- VVVVkkkkMMMMeeeetttteeeerrrr((((3333xxxx)))) VVVVkkkkMMMMeeeetttteeeerrrr((((3333xxxx))))
-
-
-
- CLASSES USED BY THIS CLASS
- VkApp
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- VkDoubleBuffer, VkComponent, VkApp, VkPie
- _V_i_e_w_K_i_t _P_r_o_g_r_a_m_m_e_r'_s _G_u_i_d_e
- _T_h_e _X _W_i_n_d_o_w _S_y_s_t_e_m, DEC Press, Bob Sheifler and Jim Gettys
- _T_h_e _X _W_i_n_d_o_w _S_y_s_t_e_m _T_o_o_l_k_i_t, DEC Press, Paul Asente and Ralph Swick
- _T_h_e _O_S_F/_M_o_t_i_f _P_r_o_g_r_a_m_m_e_r_s _R_e_f_e_r_e_n_c_e, Prentice Hall, OSF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 6666
-
-
-
-